<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@include file="/manage/user/check_login.jsp" %>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<meta name="viewport" content="width=device-width,initial-scale=0.2, minimum-scale=0.23, maximum-scale=1.0, user-scalable=no">
<link href="/images/logo.ico" rel="shortcut icon">
<title>修改账户密码</title>
<link type="text/css" href="/common/css/common.css" rel="stylesheet"/>
<style type="text/css">
	 td{padding:0px;}
</style>
<link rel="stylesheet" href="/manage/assets/css/bootstrap.min.css">
<script type="text/javascript" src="/common/js/common.js"></script>
<script type="text/javascript" src="/common/js/jquery1.8.3.js"></script>
<script type="text/javascript">
  function checkPassword() {
     var form = document.forms[0];
     var oldPassword = form.oldPassword;
	 var surepassword = form.surepassword;
	 var password = document.getElementById("password");
	 if (oldPassword.value.trim() == "") {
	     alert("请输入原密码！");
		 oldPassword.focus();
		 return false;
	 }
	 if (password.value.trim() == "") {
	     alert("请输入密码！");
		 password.focus();
		 return false;
	 }else if(password.value.trim().length<6){
		 alert("密码不合法，密码由6-20个数字或英文组成！");
		 password.focus();
		 return false;
	}else if (surepassword.value.trim() == "") {
	     alert("请输入确认密码！");
		 surepassword.focus();
		 return false;
	 }
	 else if (surepassword.value.trim() != password.value.trim()) {
	     alert("输入的两次密码不一样，请确认后重输！");
		 return false;
	 }
	 return true;
  }
</script>
</head>

<body>

            	<s:form id="devForm" name="devForm" theme="simple" method="post" action="/userAction!updatePassword.chtml" onsubmit="return checkPassword();">
<div class="card">
	<div class="card-header">
		<strong class="card-title">修改登录密码</strong>
	</div>
	<div class="card-body">
		<table id="bootstrap-data-table" class="table">
                	<s:if test="msg!=null">
                    	<tr>
                            <td></td>
                            <td><font color="red"><b><s:property value="msg" /></b></font></td>
                        </tr>
                    </s:if>
                	<tr>
                    	<td width="100px">旧 密 码：</td>
                        <td><input name="oldPassword" type="password" id="oldPassword" size="25"/><b>*</b></td>
                    </tr>
                    <tr>
                    	<td>新 密 码：</td>
                        <td><input name="u.password" type="password" id="password" size="25"/><b>*</b></td>
                    </tr>
                    <tr>
                        <td height="30" >确认密码：</td>
                        <td><input name="surepassword" type="password" size="25"/><b>*</b></td>
                    </tr>
                    <tr style="padding-bottom:10px;">
                        <td colspan="2"><input type="submit" name="Submit" value="修改" class="btn_45"/>　<input type="reset" value="取消" class="btn_45"/></td>
                    </tr>
                </table></div></div>
                </s:form>

</body>
</html>
